package com.example.contentcenter.controller.content;

import com.example.contentcenter.domain.dto.content.ShareAuditDTO;
import com.example.contentcenter.domain.entity.content.Share;
import com.example.contentcenter.service.content.ShareService;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @ClassName: ShareAdminController
 * @Author: lerry_li
 * @CreateDate: 2021/06/05
 * @Description
 */
@RestController
@RequestMapping("/admin/shares")
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class ShareAdminController {

    private final ShareService shareService;

    @PutMapping("/audit/{id}")
    public Share auditById(@PathVariable  Integer id, @RequestBody ShareAuditDTO shareAuditDTO){
        //TODO 认证、授权
        return this.shareService.auditById(id,shareAuditDTO);
    }
}
